<!--
 描述: 金字塔趋势
 作者: Jack Chen
 日期: 2020-04-18
-->

<template>
  <div class="hbh-container">
    <commonTitle :title="'设备汇总'" />
    <div class="stage">
      <div class="itemBox" v-for="(item, index) in infoData" :key="index">
        <div class="stackImg">
          <img :src="item.img1" alt="" /><img
            src="https://files.axshare.com/gsc/E0EL5C/fd/21/59/fd2159f2f7f94050a3ed7c0fb1c4079a/images/%E7%83%AD%E6%B3%B5%E7%B3%BB%E7%BB%9F/u224.png?pageId=1faa738d-2fb6-4c2f-b893-e9f972d8c348"
            alt=""
          />
        </div>
        <div class="stackTip">
          <span>{{ item.title }}</span
          ><span>{{ item.number }}</span
          ><span>台</span>
        </div>
        <div class="stackValue">
          <div class="staus">
            <span class="normal">正常</span><span>{{ item.normal }}</span>
          </div>
          <div class="staus">
            <span class="offline">离线</span><span>{{ item.offline }}</span>
          </div>
          <div class="staus">
            <span class="warn">故障</span><span>{{ item.fault }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "pyramidTrend",
  data() {
    return {
      infoData: [
        {
          title: "热泵",
          number: 60,
          normal: 5,
          offline: 1,
          fault: 0,
          img1:
            "https://files.axshare.com/gsc/E0EL5C/fd/21/59/fd2159f2f7f94050a3ed7c0fb1c4079a/images/%E7%83%AD%E6%B3%B5%E7%B3%BB%E7%BB%9F/u225.png?pageId=1faa738d-2fb6-4c2f-b893-e9f972d8c348",
        },
        {
          title: "中继器",
          number: 40,
          normal: 15,
          offline: 1,
          fault: 0,
          img1:
            "https://files.axshare.com/gsc/E0EL5C/fd/21/59/fd2159f2f7f94050a3ed7c0fb1c4079a/images/%E7%83%AD%E6%B3%B5%E7%B3%BB%E7%BB%9F/u240.png?pageId=1faa738d-2fb6-4c2f-b893-e9f972d8c348",
        },
        {
          title: "水控机",
          number: 120,
          normal: 5,
          offline: 10,
          fault: 0,
          img1:
            "https://files.axshare.com/gsc/E0EL5C/fd/21/59/fd2159f2f7f94050a3ed7c0fb1c4079a/images/%E7%83%AD%E6%B3%B5%E7%B3%BB%E7%BB%9F/u249.png?pageId=1faa738d-2fb6-4c2f-b893-e9f972d8c348",
        },
      ],
    };
  },
  mounted() {},
  methods: {},
  beforeDestroy() {},
};
</script>

<style lang="scss" scoped>
.hbh-container {
  width: 100%;
  margin-bottom: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  .stage {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .itemBox {
      width: 140px;
      padding: 10px 0px;
      .stackImg {
        height: 100px;
        // background-color: pink;
        margin-bottom: 10px;
        position: relative;
        img:nth-of-type(1) {
          position: absolute;
          z-index: 1;
          top: 0px;
          left: calc(50% - 26px);
          width: 52px;
          height: 56px;
        }
        img:nth-of-type(2) {
          position: absolute;
          top: 16px;
          left: calc(50% - 66px);
          width: 132px;
          height: 84px;
        }
      }
      .stackTip {
        height: 45px;
        margin-bottom: 10px;
        background-image: url("https://files.axshare.com/gsc/E0EL5C/fd/21/59/fd2159f2f7f94050a3ed7c0fb1c4079a/images/%E7%83%AD%E6%B3%B5%E7%B3%BB%E7%BB%9F/u226.svg?pageId=1faa738d-2fb6-4c2f-b893-e9f972d8c348");
        background-repeat: no-repeat;
        background-size: cover;
        display: flex;
        align-items: center;
        justify-content: center;
        span {
          color: #d9dadb;
        }
        span:nth-of-type(2) {
          color: #19d2ad;
          font-size: 30px;
          margin: 0 10px;
        }
      }
      .stackValue {
        height: 92px;
        background-image: url("https://files.axshare.com/gsc/E0EL5C/fd/21/59/fd2159f2f7f94050a3ed7c0fb1c4079a/images/%E7%83%AD%E6%B3%B5%E7%B3%BB%E7%BB%9F/u227.png?pageId=1faa738d-2fb6-4c2f-b893-e9f972d8c348");
        background-repeat: no-repeat;
        background-size: cover;
        padding: 10px 20px;
        box-sizing: border-box;
        .staus {
          display: flex;
          justify-content: space-between;
          position: relative;
          span:nth-of-type(1)::before {
            content: "";
            width: 8px;
            height: 8px;
            position: absolute;
            top: calc(50% - 4px);
            left: -10px;
            border-radius: 50%;
          }
          .normal::before {
            background-color: #65fea0;
          }
          .offline::before {
            background-color: #d9dadb;
          }
          .warn::before {
            background-color: red;
          }
        }
      }
    }
  }
}
</style>
